package org.csu.hotelsys.service;


import org.csu.hotelsys.domain.Admin;
import org.csu.hotelsys.persistence.AdminMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminService {
    @Autowired
    private AdminMapper adminMapper;

    //注册管理员
    public void insertAdmin(Admin admin) {
        adminMapper.insertAdmin(admin);
    }

    //管路员登录验证
    public Admin getAdmin(String adminname, String password) {
        Admin admin = new Admin();
        admin.setAdminname(adminname);
        admin.setPassword(password);
        return adminMapper.getAdminByUsernameAndPassword(admin);

    }

}
